LGF_DTLToUnixTime (FC / 3.0.2)

Overview

Author: Siemens Digital Industry

Short description

This function converts the date and time of data type DTL to the UNIX time of data type DInt. The timestamp is calculated in UTC. This means that the time zone is not considered.

Only times after 01/01/1990 are permitted.

Block Interface

LGF_DTLToUnixTime (FC)
DTL  timeDTL Ret_Val  DInt
    
   error  Bool
    
   status  Word
    
   

Input parameter

IdentifierData type Description
timeDTLDTL Date and time as DTL to convert to UNIX time

Output parameter

IdentifierData type Description
Ret_ValDInt Converted UNIX time
errorBool FALSE: No error
TRUE: An error occurred during the execution of the FB
statusWord 16#0000-16#7FFF: Status of the FB
16#8000-16#FFFF: Error identification (see following Table)

Status & Error codes

Code / ValueIdentifier / Description
16#0000STATUS_EXECUTION_FINISHED_NO_ERROR
Execution finished without errors
16#8000ERR_TIME_BEFORE_1990
Error: Input time is before 01/01/1990. The function does not support this conversion, because of internal used datatype
16#8001ERR_DTL_INPUT_VALUE_INVALID
Error: Input timestamp value not valid. The data type contains implausible data.

Change log

Version & DateChange description
1.0.0Siemens Industry Online Support
16.10.2018First released version
1.0.1Simatic Systems Support
20.06.2019Standard header and block parameters update, status parameter added
1.0.2Simatic Systems Support
10.07.2019Commends added and code refactoring
Add ENO handling
3.0.0Simatic Systems Support
23.04.2020Set version to V3.0.0
Harmonize the version of the whole library
3.0.1Simatic Systems Support
23.02.2021Insert documentation
3.0.2Simatic Systems Support
14.04.2023Improve data verification for input `timeDTL` for valid data